const actionTypes = {
  SET_PROJECT_LIST: "SET_PROJECT_LIST"
};

export default {
  namespaced: true,
  state: {
    // 我的项目列表
    myProjectList: [],
    // 其他列表
    otherProjectList: []
  },
  mutations: {
    [actionTypes.SET_PROJECT_LIST](state, payload) {
      const { type, list } = payload;
      state[type] = list;
    }
  },
  actions: {
    // 设置列表
    setList({ commit }, payload) {
      commit(actionTypes.SET_PROJECT_LIST, payload);
    }
  },
  getters: {
    myProjectList: (state) => state.myProjectList,
    otherProjectList: (state) => state.otherProjectList
  }
};
